CXX=g++
CXXFLAGS = -DNDEBUG -O3 -s
EXEEXT = $(shell if uname -a | grep -q -i cygwin; then echo .exe; fi)
CXXDEBUG=-g -O0 -fno-inline -DLOG -DDEBUG -Wall -Wextra

aga_SOURCES = \
aga.cpp \
default_init.cpp \
fitness.cpp \
heuristics.cpp \
localsearch.cpp \
matrixio.cpp \
memory.cpp \
operators.cpp \
optimizer.cpp \

aga_OBJECTS := $(aga_SOURCES:.cpp=.o)

all: aga$(EXEEXT)

# aga: $(aga_OBJECTS)
aga$(EXEEXT): $(aga_SOURCES)
	$(CXX) $(CXXFLAGS) -o $@  $^

agadb$(EXEEXT): $(aga_SOURCES)
	$(CXX) $(CXXDEBUG) -o $@  $^
	../util/strip_stl_boost.py $@

agalog$(EXEEXT): $(aga_SOURCES)
	$(CXX) $(CXXFLAGS)  -DLOG -DPRINT_CSV_HEADER -o $@  $^


.cpp.o:	aga.h
	$(CXX) $(CXXFLAGS) -c -o $@ $<

$(aga_OBJECTS): aga.h

clean:
	rm -f aga$(EXEEXT) agadb$(EXEEXT) $(aga_OBJECTS)

.PHONY: all clean


